package tree.tree;

public class Text {
    public static void main(String[] args) {
        Solution solution = new Solution();
        int[] preorder = new int[] {3,9,20,15,7};
        int[] inorder = new int[] {9,3,15,20,7};
        solution.buildTree(preorder,inorder);
    }
    public static void main1(String[] args) {
        BinaryTree binaryTree = new BinaryTree();
        BinaryTree.TreeNode root = binaryTree.createTree();
        System.out.println("===");

        binaryTree.preOrder(root);
        System.out.println();
        binaryTree.inOrder(root);
        System.out.println();
        binaryTree.postOrder(root);
        System.out.println();
        System.out.println("节点的个数: " + binaryTree.size(root));
        System.out.println("叶子节点的个数: " + binaryTree.getLeafNodeCount(root));
        System.out.println("第K层节点的个数: " + binaryTree.getKLevelNodeCount(root,2));
        System.out.println("二叉树的高度: " + binaryTree.getHeight(root));
        BinaryTree.TreeNode ret = binaryTree.find(root,'E');
        System.out.println("层序遍历 ：");
        binaryTree.levelOrder(root);
    }
}
